<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小U商城</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            font-size: 16px;
        }


        .header {
            background: #333;
            color: #fff;
            padding: 1rem;
            text-align: center;
        }

        .nav a {
            color: #fff;
            text-decoration: none;
            margin: 0 1rem;
        }

        .main {
            padding: 1rem;
        }

        .products {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
            padding: 1rem;
            text-align: center;
        }

        .product {
            background: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            transition: transform 0.3s, box-shadow 0.3s;
        }

        .product:hover {
            transform: scale(1.03);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
        }

        .product img {
            width: 100%;
            height: auto;
            display: block;
        }

        .product h2 {
            font-size: 1.2rem;
            margin: 0.5rem 0;
        }

        .product p {
            font-size: 1rem;
            color: #333;
            margin: 0.5rem 0;
        }

        .product button {
            background: #007bff;
            color: #fff;
            border: none;
            padding: 0.75rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 1rem;
            transition: background 0.3s;
        }

        .product button:hover {
            background: #0056b3;
        }

        .footer {
            background: #333;
            color: #fff;
            text-align: center;
            padding: 1rem;
            position: absolute;
            width: 100%;
            bottom: 0;
        }

        /* 媒体查询 */
        @media (max-width: 600px) {
            body {
                background-color: lightblue;
            }
        }
    </style>
</head>

<body>
    <header class="header">
        <h1>小U商城</h1>
        <nav class="nav">
            <a href="#">首页</a>
            <a href="#">产品</a>
            <a href="#">联系我们</a>
        </nav>
    </header>
    <main class="main">
        <section class="products">
            <article class="product">
                <h2>产品1</h2>
                <p>价格: ¥99.00</p>
                <button>加入购物车</button>
            </article>
            <article class="product">
                <h2>产品2</h2>
                <p>价格: ¥149.00</p>
                <button>加入购物车</button>
            </article>
            <article class="product">
                <h2>产品3</h2>
                <p>价格: ¥199.00</p>
                <button>加入购物车</button>
            </article>
            <article class="product">
                <h2>产品4</h2>
                <p>价格: ¥249.00</p>
                <button>加入购物车</button>
            </article>
        </section>

    </main>
    <footer class="footer">
        <p>&copy; 2024 小U商城. 保留所有权利。</p>
    </footer>
</body>

<script>
    console.log('这是购物车页面')
</script>

</html>